#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "plistparser.h"
#include "maincontroller.h"
#include "CommonMarcro.h"

class PlistParser;
class PlistFrameListModel;

namespace Ui {
    class MainWindow;
}


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

signals:    

private slots:


    void on_NewAction_clicked();

    void on_DeleteAction_clicked();

    void on_addFrame_clicked();

    void on_removeFrame_clicked();

    void on_actionSave_Data_triggered();

    void on_actionSave_Data_As_triggered();

    void on_actionLoadData_triggered();

    void on_actionOpen_Plist_File_triggered();

    void on_actionNew_Data_triggered();

    void on_stopAnimation_clicked();

    void on_playAnimation_clicked();

private:
    void setupDataController();
    void handleSaveDataToFile(QString& filePath);
    void addPlistFile();
    void saveDataAsFile();
    void loadDataFromFile();
    void playAnimation();
    void stopAnimation();

    Ui::MainWindow *ui;
    PlistParser* m_parser;
    PlistFrameListModel* m_frameListModel;
    QString m_plistPath;
    QString m_dataPath;

private:
    MainController* m_mainController;



};

#endif // MAINWINDOW_H
